#include "lib/global.h"
#include "lib/memctrl.h"
#include "memory/memory.h"
int main(void)
{
    //五个需要申请内存的进程
    ptr_t blocks[5];
    //管理40个块
    InitMemory();
    blocks[0] = ApplyMemory(1, 800);
    blocks[1] = ApplyMemory(1, 500);
    FreeMemory(1, blocks[0], 800);
    blocks[2] = ApplyMemory(1, 500);
    blocks[3] = ApplyMemory(1, 1900);
    FreeMemory(1, blocks[2], 500);
    FreeMemory(1, blocks[1], 500);
    blocks[0] = ApplyMemory(1, 800);
    blocks[2] = ApplyMemory(1, 1000);
    blocks[4] = ApplyMemory(1, 600);
    while(1);
    return 0;
}